package br.com.evl.tecinfo.dao;

import br.com.evl.tecinfo.modelo.RegHorExt;
import java.sql.SQLException;

/**
 *
 * @author Jalisson
 */
public class RegistroHoras_DAO extends DAO<RegHorExt> {

    public RegistroHoras_DAO() {

        super.conectarAoBD();
    }

    @Override
    public void inserir(RegHorExt regHorExt) {

        String[] valores = {          
            String.valueOf(regHorExt.getAno()),
            String.valueOf(regHorExt.getMes()),
            String.valueOf(regHorExt.getBh()),
            String.valueOf(regHorExt.getOutros()),
            String.valueOf(regHorExt.getQuanthoras()),
            String.valueOf(regHorExt.getOutros()),
            String.valueOf(regHorExt.getNome()),
        };

        super.setValores(valores);
    }

    @Override
    public void remover(RegHorExt regHorExt) {

        try {
            st.executeUpdate("DELETE FROM Usuario WHERE cpf = '" + regHorExt.getNome()+ "'");

        } catch (SQLException ex) {
            System.out.println("nao foi possivel remover");
        }
    }

    @Override
    public void setTable(String tabela) {

        super.tabela = "Usuario";
    }
}
